<%@ page language="java" import="java.util.*" import="java.sql.*" pageEncoding="utf-8"%>
<html>
<head>
<title>页面</title>
<style type="text/css">
/*top*/
body{margin:0 auto;padding:0 auto;text-align: center;width:980px;}

span{font-size:13px;}

table{border:1px dashed white;background: white;}

.content{float: right;top: -180px;position: relative;}

.info{margin-left: 800px;position: relative;top:-250px;}

.div_content table{border:1px solid white;background: white;}/*/////////////////////////////////////////////////////*/

td{border: 1px dashed gray;}

ul, li { list-style:none;}

a { text-decoration:none;}

.nav {margin-top: -10px;margin-left: 50px;}/*////////////////////////////////////////////////*/

.jieshao{float: left;position: relative;left: 200px;}

.nav ul li { float:left;}

.nav ul li a { width:120px; height:40px; text-align:center; line-height:40px; display:block; border-right:2px solid #ccc; background:#eee; color:#666;}

.nav ul li a:hover{ color:#f00;background: #000000;}

.nav ul li ul { position:absolute; display:none;}

.nav ul li ul li { float:none;}

.nav ul li ul li a { border-right:none; border-top:1px dotted #ccc; background:#f5f5f5;}

.nav ul li:hover ul{ display:block; }

.top{margin: 5px auto 0px auto;padding: 0px;width:980px;height:78px;text-align: left;}

.logo{margin-right: 900px;}

.banner{width: 307px;height: 61px;float:left;margin-top: -10px;}

.options{float: right;margin: -20px;}

.home,.shu,.fav{float: leftmargin: 0 16px;padding:0 0 auto auto;display: inline;padding: 0px 0px;margin-right: 20px;}

.home a,.shu a,.fav a{color: #9b9b9b;float: left;margin-left: 15px;margin-top: -10px;}
/*top*/
.content{margin: 80px 0px ; }

h1{ background:black; font-size:14px; height:35px; line-height:35px; padding-right:900px; color:white;margin-top: 80px;}

h4{text-align: center;}

.zhuangtai{position: relative;left: 200px; font-size: 13px; color:red;}

.zhuangtai1{position: relative;left: 200px; font-size: 13px; color:gray;}

#Methods1{ width:900px;height:110px; background:#ccc;}

#Methods1 dl{margin:0px 10px 0 10px; float:left; border:1px solid gray;}

#Methods1 dt{width:180px; margin:10px; height:90px; background:#FFF;}

#Methods1 dd{width:180px; margin:0 0 10px 10px; height:20px; line-height:30px; background:#FFFFFF; text-align:center;}

.td1{margin-top: 0px;}

.td2{margin-top: 0px;}

.td3{margin-top: 0px;}

.td4{margin-top: 0px;}

.td1 .td1_content{float: left;}

.tips{margin-top: 0px;margin-right: 170px;}

.tips span{color:gray;font-size: 13px;}

.tips ul{margin-right: 50px;}

hr{border:1px dashed gray;width:980px;}

.comment{text-align: left;}

sup{font-size: 10px;}
/*nav*/
</style>

</head>
  <body>
   <%@ include file="dengluPublic.jsp" %>
 <%@ include file="daohangPublic.jsp"%>
   
   <h1><font>作品信息</font></h1>
	    <%!
	    String id;
	    String idAfter;
	    String zhuangtai;
	    String message; 
	    String zhengwen;
	    String publisher;
	    String zhuangtaiColor;
	    String jcishu;
	    %>
	     	
	       <%
	    id=request.getParameter("id");
	    System.out.println("id"+id);
	     %>
	     <%!
		    	String cno;
		    	 %>
		    	<%
		    	String driverClass2="com.mysql.jdbc.Driver";
			    String url2="jdbc:mysql://localhost:3306/vote?useSSL=false";
			    String user2="root";
			    String password2="womenilu2580";
			    Class.forName(driverClass2);	   
			    Connection conn2=DriverManager.getConnection(url2,user2,password2);
			    Statement stat2=conn2.createStatement();	 
			    String sql2="select publisher,cno from science where id="+id+"";
			    System.out.println("这里的id是"+id);
			    ResultSet rs2=stat2.executeQuery(sql2);
			    while(rs2.next()){			  
			    cno=rs2.getString("cno");	
			    System.out.println("cno是"+cno);
			    }  
		    	 %>
	    <% 
		String driverClass="com.mysql.jdbc.Driver";
	    String url="jdbc:mysql://localhost:3306/vote?useSSL=false";
	    String user="root";
	    String password="womenilu2580";
	    Class.forName(driverClass);
	    Connection conn=DriverManager.getConnection(url,user,password);
	    Statement stat=conn.createStatement();	 
	    String sql="select id,zhuangtai as zt,message,zhengwen,publisher,jcishu from science where id='"+id+"'";
	    ResultSet rs=stat.executeQuery(sql);
	    while(rs.next()){
	    zhuangtai=rs.getString("zt");  
	    message=rs.getString("message");	    
	    zhengwen=rs.getString("zhengwen");	
	    publisher=rs.getString("publisher");
	    jcishu=rs.getString("jcishu");
	    idAfter=rs.getString("id");
	    System.out.println("查询到的idAfter"+idAfter);
	    }
	    if(!customer.getCname().equals(publisher))
	    {
	    if(zhuangtai.equals("借出"))
	    {
	  
	    %> 
<div id="Methods1">
	<table width="980px">
<tr>
	<td style="height:100px;">
		<div class="td1">
			<dl>
		    	<dt><a href="#"><img src="img/logo.jpg" width="180px" height="90px" /></a></dt>
		    	<dd>-上传者：<a href="customerPage.jsp?cno=<%=cno%>"><%=publisher %></a>-
		    	<sup><a href="sciencechat.jsp?id=<%=idAfter%>">在线交谈</a></sup>
		    	</dd>
		    </dl>
	    </div>	
	   
	    <div class="div_content">
	    	<h4><%=message %><font class="zhuangtai">状态：<%= zhuangtai %><sup>被借次数:(<%=jcishu %>)</sup></font></h4>
	    	
	    	<table class="content" width="750px" style="text-align: left;">
		    	<tr><td>		    	
		    	 <p><%=zhengwen %></p>
		    	 </td></tr>		    	 
			</table>			
		</div> 		
		<%}
		else
	{%>

		<div id="Methods1">
	<table width="980px">
<tr>
	<td style="height:100px;">
		<div class="td1">
			<dl>
		    	<dt><a href="#"><img src="img/logo.jpg" width="180px" height="90px" /></a></dt>		   
		    	<dd>-上传者：<a href="customerPage.jsp?cno=<%=cno%>"><%=publisher %></a>-
		    	<sup><a href="sciencechat.jsp?id=<%=idAfter%>">在线交谈</a></sup>
		    	</dd>
		    </dl>
	    </div>	
	   
	    <div class="div_content">
	    <%System.out.println("我在测试id是多少/////////////////////"+id); %>
	    	<h4><%=message %><font class="zhuangtai1">状态：<a href="zhuangtaiZhuanbian.jsp?id=<%=id%>"><%= zhuangtai %><sup>被借次数:(<%=jcishu %>)</sup></a></font></h4>
	    	
	    	<table class="content" width="750px" style="text-align: left;">
		    	<tr><td>		    	
		    	 <p><%=zhengwen %></p>
		    	 </td></tr>
			</table>
		</div> 
		
		<%
		    	}
		    	}
		    	
			    	else{
			    	%>
			    	<% if(zhuangtai.equals("借出"))
		    {
		  
		    %> 
	<div id="Methods1">
		<table width="980px">
	<tr>
		<td style="height:100px;">
			<div class="td1">
				<dl>
			    	<dt><a href="#"><img src="img/logo.jpg" width="180px" height="90px" /></a></dt>
			    	<dd>-上传者：<a href="customerPage.jsp?cno=<%=cno%>"><%=publisher %></a>-			    	
			    	</dd>
			    </dl>
		    </div>	
		   
		    <div class="div_content">
		    	<h4><%=message %><font class="zhuangtai">状态：<%= zhuangtai %><sup>被借次数:(<%=jcishu %>)</sup></font></h4>
		    	
		    	<table class="content" width="750px" style="text-align: left;">
			    	<tr><td>		    	
			    	 <p><%=zhengwen %></p>
			    	 </td></tr>
				</table>
			</div> 
			<%}
			else
		{%>
	
			<div id="Methods1">
		<table width="980px">
	<tr>
		<td style="height:100px;">
			<div class="td1">
				<dl>
			    	<dt><a href="#"><img src="img/logo.jpg" width="180px" height="90px" /></a></dt>		   
			    	<dd>-上传者：<a href="customerPage.jsp?cno=<%=cno%>"><%=publisher %></a>-			    	
			    	</dd>
			    </dl>
		    </div>	
		   
		    <div class="div_content">
		    	<h4><%=message %><font class="zhuangtai1">状态：<%= zhuangtai %><sup>被借次数:(<%=jcishu %>)</sup></font></h4>
		    	
		    	<table class="content" width="750px" style="text-align: left;">
			    	<tr><td>		    	
			    	 <p><%=zhengwen %></p>
			    	 </td></tr>
				</table>
			</div> 
			
			<%
			    	}
			    	%>
			    	<%
			    	
		    	}
		    	%>
		    
	     
	</td>
</tr>
</table>
<font style="font-size: 19px;float: left;"><b>评论</b></font><br /><hr/>
<%!String xinxi;
String cname;
	    %>	
	    <% 		
	    String driverClass1="com.mysql.jdbc.Driver";
	    String url1="jdbc:mysql://localhost:3306/vote?useSSL=false";
	    String user1="root";
	    String password1="womenilu2580";	
	    Class.forName(driverClass1);
	    Connection conn1=DriverManager.getConnection(url1,user1,password1);
	    Statement stat1=conn1.createStatement();	 
	    String sql1="select xinxi,cname from comment where message='"+message+"'";
	    ResultSet rs1=stat.executeQuery(sql1);
	    while(rs1.next()){
	    xinxi=rs1.getString("xinxi");
	    cname=rs1.getString("cname");  	  
	    System.out.println(xinxi+","+cname);
	     %>
	    <div class="comment"><b><%=cname%>:</b><%=xinxi %><br/></div><hr />
		<%
			}
			
		%>
		<br/>
		<form action="commentAction.jsp"method="post">
		<textarea name="comment" rows="8" cols="120"></textarea><br />
		<input type="submit" value="发表"/><input type="hidden" name="message1" value="<%=message%>"/>
		</form>
		<br/>
本站由Dany团队搭建，欢迎有兴趣的朋友加入我们，一起建造更优质的平台
<br/>
作者联系方式：1029046433(qq)
</div>
  </body>
</html>
